// import './assets/main.css'

// import { createApp } from 'vue'
// import App from './App.vue'

// createApp(App).mount('#app')


import { createApp,reactive  } from 'vue'
import App from './App.vue'
import router from './router' // 确保导入了router
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './assets/base.css' // 导入主样式文件

// 创建全局状态
const globalState = reactive({
  hideMenuBackground: false
})

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus)
app.use(router) // 确保使用了router

// 将全局状态注入到应用中
app.provide('$globalState', globalState)

// 监听路由变化
router.afterEach((to) => {
  globalState.hideMenuBackground = to.name === 'PredictResult'
})



app.mount('#app')